<?php

class Form extends CI_Controller {

public function __construct()
	{
		parent::__construct();

		$this->load->model('form_model');
	}

	public function index()
	{
		if($_POST) {
			// wala ka man sang "register" na function sa "form_model".. ma error ni sya..
			$this->form_model->register(array(
				'username' => $this->input->post('username'),
				'email' => $this->input->post('email'),
				'password' => sha1($this->config->item('auth_pass_salt1').$this->input->post('password').$this->config->item('auth_pass_salt2'))
			));
		}
		$data['page'] = 'view_register';
		$this->load->view('index', $data);
	}
}
?>